package com.demo;

import java.util.Random;

/**
 * <p>
 * <code>Num2</code>
 * </p>
 *
 * @author junbao3
 * TODO
 * @date 2023-03-21 15:27
 * Copyright (C) 2021 IFlyTek. All rights reserved.
 */
public class Num2 {
    public static void main(String[] args) {
        Random random = new Random();
        int i = random.nextInt(100);
        System.out.println("i="+i);
        if (i<=1){
            System.out.println("数据违法");
        }
        if ((i & (i-1))==0){
            System.out.println(i+"是2的N次方");
        }else{
            System.out.println(i+"不是2的N次方");

        }
    }
}
